// Initialize Sortable in Group's Assignment list.
$(document).ready(function() {
	// Turn list into sortable.
	$("#AssignmentList").sortable({
		placeholder: 'ui-state-highlight',
		handle: '.handle',
		stop: function(event,ui) {
			// After update, go thru all list items to set the -order fields.
			$("#assignment_list > * > [name$='-order']").each( function(i) {
				this.value=i+1;
			});
		}
	});
});